<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
         span {
        border-bottom: 1px solid black;
        width: 100px;
        display: inline-block;
        text-align: center;
        }

        input {
            outline: 0;
            border: 0;
            border-bottom: 1px solid black;
            width: 100px;
            font-size: 16px;
            text-align: center;
        }
    </style>
</head>
<body>
    <div id="root">
        <fieldset>
            <legend>三国</legend>
            <p v-for="(v,k,i) in arr1">
                <label for="">{{k}}</label>:
                <input type="text" v-model="val" ref="ipt" @blue="esc(k)" v-if="isEdit&&i===selectedIndex">
                <span @dblclick="edit(v,i)" v-else>{{v}}</span>
            </p>
        </fieldset>
    </div>
    <script src="http://unpkg.zhimg.com/vue@2"></script>
    <script>
    const vm = new Vue({
        el: "#root",
        data: {
            arr1: {
                "蜀国": "关羽",
                "魏国": "司马懿",
                "吴国": "周瑜", 
                "群雄": "吕布"
            },
            val: "夏洛",
            isEdit: false,
            selectedIndex: ""
        },
        methods:{
            edit(v, i) {
                this.isEdit = true;
                this.selectedIndex = i;
                this.val = v;               
            },
            esc(k) { 
                this.isEdit = false;
                console.log(k);
                this.userInfo[k] = this.val
            }
        }
    })
    </script>
</body>
</html>